﻿using System.Collections.ObjectModel;
using T4UtilityBelt.UxDesigns.Controls.Renderers;

using T4UtilityBelt.Writers;

namespace T4UtilityBelt.UxDesigns.Controls
{
    public class ItemTemplateControlCollection : Collection<ItemTemplateControl>
    {
        protected static IItemTemplateCollectionRenderer CreateControlRenderer(Platforms platform)
        {
            return RendererHelper.CreateRenderer<IItemTemplateCollectionRenderer>(platform);
        }

        public void RenderUiXml(CodeWriter writer)
        {
            CreateControlRenderer(writer.Platform).RenderUi(this, writer);
        }

        public string RenderUiXml(Platforms platform)
        {
            CodeWriter writer = new CodeWriter(platform);
            RenderUiXml(writer);
            return writer.ToString();
        }

    }
}
